import request from '@/utils/request'


// 导出产品
export function exportProduct(query) {
  return request({
    url: '/sks/product/export',
    method: 'get',
    params: query,
    // responseType: 'blob',
    // headers: {
    //   'Content-Type': 'multipart/x-www-form-urlencoded'
    // }
  })
}

// 导入产品
export function importData(data) {
  return request({
    url: '/sks/product/importData',
    method: 'post',
    data:data,
    headers:{
      "Content-Type": "multipart/form-data",
    }
  })
}

// 导出模板
export function importTemplate() {
  return request({
    url: '/sks/product/importTemplate',
    method: 'get',
  })
}


// 删除产品
export function delProduct(deptId) {
  return request({
    url: '/sks/product/' + deptId,
    method: 'delete'
  })
}

// 编辑产品
export function editProduct(data) {
  // console.log(query,"query");
  return request({
    url: '/sks/product',
    method: 'put',
    data:data
  })
}

// 获取产品列表

export function productList(query) {
  return request({
    url: '/sks/product/list',
    method: 'get',
    params:query
  })
}
export function productListFC(query) {
  return request({
    url: '/sks/product/insertList',
    method: 'get',
    params:query
  })
}
// 辅材产品类别
// export function secondList(query) {
//   return request({
//     url: '/sks/product/secondList',
//     method: 'get',
//     params:query
//   })
// }
// 新增产品
export function newProduct(data) {
  return request({
    url: '/sks/product',
    method: 'post',
    data: data
  })
}

//图片查询接口
export function getImgUrl(data) {
  return request({
    url: '/common/upload',
    method: 'post',
    data: data,
  })
}

